/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.dao.recent;

import java.io.Serializable;
import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.jili.ubert.code.CodeTool;
import java.io.IOException;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dragon
 */
@Entity
@Table(name = "recent_obj_indexlist")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RecentObjIndexList.findAll", query = "SELECT r FROM RecentObjIndexList r"),
    @NamedQuery(name = "RecentObjIndexList.findById", query = "SELECT r FROM RecentObjIndexList r WHERE r.id = :id"),
    @NamedQuery(name = "RecentObjIndexList.findByIndexID", query = "SELECT r FROM RecentObjIndexList r WHERE r.indexID = :indexID"),
    @NamedQuery(name = "RecentObjIndexList.findByIndexObj", query = "SELECT r FROM RecentObjIndexList r WHERE r.indexObj = :indexObj"),
    @NamedQuery(name = "RecentObjIndexList.findByObj", query = "SELECT r FROM RecentObjIndexList r WHERE r.obj = :obj"),
    @NamedQuery(name = "RecentObjIndexList.findByRegionID", query = "SELECT r FROM RecentObjIndexList r WHERE r.regionID = :regionID"),
    @NamedQuery(name = "RecentObjIndexList.findByMarketCode", query = "SELECT r FROM RecentObjIndexList r WHERE r.marketCode = :marketCode"),
    @NamedQuery(name = "RecentObjIndexList.findByClassCode", query = "SELECT r FROM RecentObjIndexList r WHERE r.classCode = :classCode"),
    @NamedQuery(name = "RecentObjIndexList.findByQty", query = "SELECT r FROM RecentObjIndexList r WHERE r.qty = :qty"),
    @NamedQuery(name = "RecentObjIndexList.findByRate", query = "SELECT r FROM RecentObjIndexList r WHERE r.rate = :rate"),
    @NamedQuery(name = "RecentObjIndexList.findByListingDate", query = "SELECT r FROM RecentObjIndexList r WHERE r.listingDate = :listingDate"),
    @NamedQuery(name = "RecentObjIndexList.findByOwnUserID", query = "SELECT r FROM RecentObjIndexList r WHERE r.ownUserID = :ownUserID"),
    @NamedQuery(name = "RecentObjIndexList.findByAlterUserID", query = "SELECT r FROM RecentObjIndexList r WHERE r.alterUserID = :alterUserID"),
    @NamedQuery(name = "RecentObjIndexList.findByCreateTime", query = "SELECT r FROM RecentObjIndexList r WHERE r.createTime = :createTime"),
    @NamedQuery(name = "RecentObjIndexList.findByTimeStamp", query = "SELECT r FROM RecentObjIndexList r WHERE r.timeStamp = :timeStamp")})
public class RecentObjIndexList implements Serializable {
	public static byte[] EnCode(RecentObjIndexList msg) throws IOException {
		Codec<RecentObjIndexList> Lcode = ProtobufProxy.create(RecentObjIndexList.class);
		return Lcode.encode(msg);
	}
	public static RecentObjIndexList DeCode(byte[] data) throws IOException {
	Codec<RecentObjIndexList> Lcode = ProtobufProxy.create(RecentObjIndexList.class);
		return Lcode.decode(data);
	}

    private static final long serialVersionUID = 1L;
    @Id
    //@GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    @Protobuf
	private Integer id;
    @Basic(optional = false)
    @Column(name = "IndexID")
    @Protobuf
	private int indexID;
    @Basic(optional = false)
    @Column(name = "IndexObj")
    @Protobuf
	private String indexObj;
    @Basic(optional = false)
    @Column(name = "Obj")
    @Protobuf
	private String obj;
    @Column(name = "RegionID")
    @Protobuf
	private String regionID;
    @Basic(optional = false)
    @Column(name = "MarketCode")
    @Protobuf
	private String marketCode;
    @Basic(optional = false)
    @Column(name = "ClassCode")
    @Protobuf
	private String classCode;
    @Basic(optional = false)
    @Column(name = "Qty")
    @Protobuf
	private int qty;
    @Basic(optional = false)
    @Column(name = "Rate")
    @Protobuf
	private float rate;
    @Basic(optional = false)
    @Column(name = "ListingDate")
    @Temporal(TemporalType.DATE)
    private Date listingDate;
	@Protobuf
	private long listingDateL;
    @Column(name = "OwnUserID")
    @Protobuf
	private String ownUserID;
    @Column(name = "AlterUserID")
    @Protobuf
	private String alterUserID;
    @Column(name = "CreateTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
	//@Protobuf
//tprivate long createTimeL;
    @Column(name = "TimeStamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date timeStamp;
	//@Protobuf
	//private long timeStampL;

    public RecentObjIndexList() {
    }

    public RecentObjIndexList(Integer id) {
        this.id = id;
    }

    public RecentObjIndexList(Integer id, int indexID, String indexObj, String obj, String marketCode, String classCode, int qty, float rate, Date listingDate) {
        this.id = id;
        this.indexID = indexID;
        this.indexObj = indexObj;
        this.obj = obj;
        this.marketCode = marketCode;
        this.classCode = classCode;
        this.qty = qty;
        this.rate = rate;
        this.listingDate = listingDate;
		this.listingDateL = CodeTool.DateToLong(listingDate);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getIndexID() {
        return indexID;
    }

    public void setIndexID(int indexID) {
        this.indexID = indexID;
    }

    public String getIndexObj() {
        return indexObj;
    }

    public void setIndexObj(String indexObj) {
        this.indexObj = indexObj;
    }

    public String getObj() {
        return obj;
    }

    public void setObj(String obj) {
        this.obj = obj;
    }

    public String getRegionID() {
        return regionID;
    }

    public void setRegionID(String regionID) {
        this.regionID = regionID;
    }

    public String getMarketCode() {
        return marketCode;
    }

    public void setMarketCode(String marketCode) {
        this.marketCode = marketCode;
    }

    public String getClassCode() {
        return classCode;
    }

    public void setClassCode(String classCode) {
        this.classCode = classCode;
    }

    public int getQty() {
        return qty;
    }

    public void setQty(int qty) {
        this.qty = qty;
    }

    public float getRate() {
        return rate;
    }

    public void setRate(float rate) {
        this.rate = rate;
    }

    public Date getListingDate() {
        return listingDate;
    }

    public void setListingDate(Date listingDate) {
        this.listingDate = listingDate;
        this.setListingDateL(CodeTool.DateToLong(listingDate));
    }

    public String getOwnUserID() {
        return ownUserID;
    }

    public void setOwnUserID(String ownUserID) {
        this.ownUserID = ownUserID;
    }

    public String getAlterUserID() {
        return alterUserID;
    }

    public void setAlterUserID(String alterUserID) {
        this.alterUserID = alterUserID;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
		//this.createTimeL = CodeTool.DateToLong(createTime);
    }

    public Date getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Date timeStamp) {
        this.timeStamp = timeStamp;
		//this.timeStampL = CodeTool.DateToLong(timeStamp);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RecentObjIndexList)) {
            return false;
        }
        RecentObjIndexList other = (RecentObjIndexList) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jili.ubert.dao.recent.RecentObjIndexList[ id=" + id + " ]";
    }

    public long getListingDateL() {
        return listingDateL;
    }

    public void setListingDateL(long listingDateL) {
        this.listingDateL = listingDateL;
		this.listingDate = CodeTool.LongToDate(listingDateL);
    }
    
}
